﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GUI.DonDatHangCuaKhachHang
{
    public partial class frmXuLy : Form
    {
        public frmXuLy()
        {
            InitializeComponent();
        }

        List<Entities.ChiTietDonHangKH> actddhkh=new List<Entities.ChiTietDonHangKH>();
        Entities.DonDatHangKH ddkh;
        private void frmXuLy_Load(object sender, EventArgs e)
        {

        }

        #region method
        void LayChiTiet()
        {
            if (ddkh != null)
            {
                Entities.ChiTietDonHangKH[] arr = Common.StaticVariable.InterfaceObject.SelectChiTietDonHangKH(ddkh.MaDonDatHangKH);
                if (arr != null)
                    actddhkh = arr.ToList<Entities.ChiTietDonHangKH>();
            }
        }
        #endregion

        private void txtMaHangHoa_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
            {
                TimKiem.frmHangHoa frm = new TimKiem.frmHangHoa();
                frm.ShowDialog();
                if (TimKiem.frmHangHoa.selectedItem != null)
                {
                    Entities.HangHoa hh=TimKiem.frmHangHoa.selectedItem;
                    TimKiem.frmHangHoa.selectedItem=null;

                    txtMaHangHoa.Text = hh.MaHangHoa;
                    txtTenHangHoa.Text = hh.TenHangHoa;
                    txtDonGia.Text = hh.GiaBanBuon;
                    txtChietKhau.Text = hh.Phantrankhuyenmai;
                    txtThueGTGT.Text = hh.GiaTriThue;
                    txtSoLuong.Focus();
                    txtSoLuong.SelectAll();

                }
            }
        }

        private void btnThemGV_Click(object sender, EventArgs e)
        {
            if (txtTenHangHoa.Text != "")
            {
                
            }
        }






    }
}
